package org.teremail.message.builder;

import org.teremail.message.Entity;
import org.teremail.message.MultipartEntity;
import org.teremail.message.MultipartMessage;
import org.teremail.message.SimpleEntity;
import org.teremail.message.SimpleMessage;

public class Builders {
    
    public static EntityBuilder createBuilder(Entity entity) {
        BuilderEntityVisitor bev = new BuilderEntityVisitor();
        entity.accept(bev);
        return bev.getEntityBuilder();
    }
    
    public static MultipartMessageBuilder create(MultipartMessage message) {
        return (MultipartMessageBuilder) createBuilder(message);
    }

    public static MultipartEntityBuilder create(MultipartEntity multipartEntity) {
        return (MultipartEntityBuilder) createBuilder(multipartEntity);
    }

    public static SimpleMessageBuilder create(SimpleMessage message) {
        return (SimpleMessageBuilder) createBuilder(message);
    }
    
    public static SimpleEntityBuilder create(SimpleEntity simpleEntity) {
        return (SimpleEntityBuilder) createBuilder(simpleEntity);
    }
}
